#pragma once

#ifdef _DEBUG
    #define DBGPRINT(_fmt, ...) printf(_fmt, __VA_ARGS__)

    #define ERRPRINT(s, c) \
        const char* str##s = #s;\
        DBGPRINT("%s: %s Error, Code: %X\r\n", __FUNCTION__, str##s, c)

    #define DBGFUNCTION(expression, keyword, s, c) \
        if (expression)\
        {\
            ERRPRINT(s, c);\
            keyword;\
        }

    #define DBGEXPRESSION(expression, keyword, _fmt, ...) \
        if (expression)\
        {\
            DBGPRINT(_fmt, __VA_ARGS__);\
            keyword;\
        }
#else
    #define DBGPRINT(_fmt, ...) {}

    #define ERRPRINT(s, c)      {}

    #define DBGFUNCTION(expression, keyword, s, c) \
        if (expression)\
        {\
            keyword;\
        }

    #define DBGEXPRESSION(expression, keyword, _fmt, ...) \
        if (expression)\
        {\
            keyword;\
        }
#endif
